Skip to content

[To resource_memory] add IOException throw to getDevices() method in TsFileResource#3703

Closed
yyt86 wants to merge 35 commits intoapache:resource_memoryfrom
yyt86:IOException_throw
Closed

[To resource_memory] add IOException throw to getDevices() method in TsFileResource#3703
yyt86 wants to merge 35 commits intoapache:resource_memoryfrom
yyt86:IOException_throw

Conversation

@yyt86
Copy link
Contributor

@yyt86 yyt86 commented Aug 9, 2021

Since we remove the devices field in FileTimeIndex class, the getDevices() method is changed to get all deviceIds from getAllDevices() method in TsFileSequenceReader class. So the IOException is thrown from getAllDevices() method in TsFileSequenceReader class to getDevices() in FileTimeIndex, then to getDevices() in TsFileReource.

@wangchao316
Copy link
Member

hi , I have a little question.
why does throw IoException?
Check whether the external interface is changed?

@yyt86
Copy link
Contributor Author

yyt86 commented Aug 10, 2021

hi , I have a little question.
why does throw IoException?
Check whether the external interface is changed?

Which IOException throw do you mean, getDevices() method in FileTimeIndex or getAllDevices() method in TsFileSequenceReader?

I don't change the getAllDevices() method in TsFileSequenceReader, and the IOException is thrown by readData method in line 565(ByteBuffer buffer = readData(metadataIndexNode.getChildren().get(i).getOffset(), endOffset);) and getAllDevices() method get the exception, and then continues to throw IOException.

If the IOException refers to that thrown by getDevices() method in FileTimeIndex, that's because the IOExpetion is thrown from getAllDevices() method in TsFileSequenceReader class which is called by getDevices() in FileTimeIndex. After removing the devices field in FileTimeIndex class, we need to get deviceIds from getAllDevices() method in TsFileSequenceReader rather than devices field, so the IOException is thrown by getAllDevices() method in TsFileSequenceReader class, then by getDevices() in FileTimeIndex, then by getDevices() in TsFileReource.

Does that make sense?

@HTHou HTHou changed the title add IOException throw to getDevices() method in TsfFileResource add IOException throw to getDevices() method in TsFileResource Aug 11, 2021
@HTHou HTHou changed the title add IOException throw to getDevices() method in TsFileResource [To resource_memory] add IOException throw to getDevices() method in TsFileResource Sep 2, 2021
@HTHou HTHou closed this Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants